import { Unitl } from "./Unitl";

Unitl.PrintStartTime();
Unitl.PrintOpeationName("数组");

let array:number[] = [1,2,3];
let newArray:Array<string> = ["abc","lvm"];

for (let i = 0;i < array.length - 1;i++)
    console.log(newArray[i]);


Unitl.PrintOpeationName("元组");
/*
元组，个人理解是一个有限自定义类型的数组
声明方式:
let meta_1:[类型_1,类型_2,...,类型_n] = [val_1,val_2,...,val_n];
必须赋值，不然报错

可选参数:在变量类型后面加? 
即:let meta_1:[类型_1,类型_2?] = [val_1,val_2];
*/
let meta_1:[number,number,string?] = [6,5,"😀"];
meta_1[2] = "lkm";

for (let i = 0;i < meta_1.length;i++)
    console.log(meta_1[i]);

Unitl.PrintOpeationName("枚举");
enum MyEnum{
    A,B,C
}

console.log(MyEnum.A);
console.log(MyEnum[0]);
for (let i = 0;i < 3;i++)
    console.log(MyEnum[i]);